Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- testapp.cpp:
- void testApp::draw(){
- ofBackground(255, 255, 255);
- ofSetColor(0);
- ifstream file ("Bin/ExText.txt");
- file >> str;
- file.open ("bin/ExText.txt");
- cout << endl << str;
- do{
- file >> gType;
- if(gType == "img3.jpg")
- // myImage.loadImage("images/"+imgName);
- ofImage myImage; // <--- Load an image
- myImage.loadImage("bin/"+imgName);
- unsigned char * pix = myImage.getPixels();
- int iw = myImage.getWidth();
- int ih = myImage.getHeight();
- /* unsigned char* scaled; // <--- create empty image for scaling
- ofTexture tex;
- scaled = new unsigned char[w*h*3];
- tex.allocate(w,h, GL_RGB);*/
- {
- file >> imgName >> x >> y >> w >> h;
- cout << "img3!"; // for debugging pursposes
- }
- testapp.h:
- #pragma once
- #include "ofMain.h"
- class testApp : public ofBaseApp{
- public:
- void setup();
- void update();
- void draw();
- void keyPressed(int key);
- void keyReleased(int key);
- void mouseMoved(int x, int y);
- void mouseDragged(int x, int y, int button);
- void mousePressed(int x, int y, int button);
- void mouseReleased(int x, int y, int button);
- void windowResized(int w, int h);
- void dragEvent(ofDragInfo dragInfo);
- void gotMessage(ofMessage msg);
- ofImage myImage;
- string str, gType, imgName, x , y, w, h, x2,y2,w2,h2;
- unsigned char* data;
- ofTexture tex;
- ofTexture myImageStr;
- int pic;
- unsigned char* pix[10];
- float alpha = 0;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement