[C++] How to fix Icon / BigIcon glitch when save .png by Photoshop

Results 1 to 1 of 1
  1. #1
    Member vinleprince is offline
    MemberRank
    Feb 2015 Join Date
    77Posts

    [C++] How to fix Icon / BigIcon glitch when save .png by Photoshop

    if you no idea what i talking about.
    when your create some icon from photoshop and save with .png to this file list
    - Res-Tex/item.tex
    - Res-Tex/bigitem.tex

    you may get black glitch when it render by client.

    there have 2 solution for you to fix.
    1. save right setting when save file
    2. fix by client source.

    i will give some guide for icon only. if you want fix bigicon just try copy paste thing.

    InterfaceLib\main\INFIcon.h (add some variable for check)
    Code:
    class CINFIcon : public CAtumNode  {
    protected:
    
    BOOL        m_IsSet; // Add this inside protected

    InterfaceLib\main\INFIcon.cpp (set up variable for make it work)
    Code:
    CINFIcon::CINFIcon()
    {
    m_IsSet = FALSE; // Add this inside function
    
    ...
    
    void CINFIcon::SetIcon(......)
    {
    m_IsSet = FALSE; // Add this inside function
    
    ...
    void CINFIcon::Render()
    {
    // scroll down a bit
    if(pImage)    {
         // Replace inside with this code
         if (m_IsSet == FALSE)
         {
              m_IsSet = TRUE;            
    pImage->Move(m_nX, m_nY);
              POINT temp = pImage->GetImgSize();
              pImage->SetScale(m_fScale, m_fScale);
              pImage->SetRect(0, 0, temp.x, temp.y); 
    // if you icon size is 28x28. you can put fixed number here and skip getimagesize(). 
    //btw better ignore it if you dont know what i mean
         }
    pImage->Render();
    }
    Last edited by vinleprince; 07-07-21 at 07:10 PM. Reason: fix space word




Advertisement